package com.smmisia.auth.aop;

import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.springframework.stereotype.Component;

import java.util.Arrays;

/**
 * @author: smmisia
 * @date: 2024-09-08
 * @description: 日志切面
 */
@Aspect
@Component
@Slf4j
public class LogAspect {
    @Before("execution(* com.smmisia.*.controller.*.*(..))")
    public void logBefore(JoinPoint joinPoint) {
        Object[] args = joinPoint.getArgs();
        log.info("Request:" + Arrays.toString(args));
    }
}
